args = inputbox("root/xs/xy/me/smt/output/bak",args,"root")
dim ws : set ws = CreateObject("WScript.Shell")
dim varName : varName = "PADS_SHORTCUT_ROOT"
dim regPath : regPath ="HKEY_CURRENT_USER\Software\MyApp\PADS\" & varName
dim root : root = ws.RegRead(regPath)
set ws = nothing

Dim doc
Set doc = application.ActiveDocument
dim doc_parent,pcb_path,prj_path,bak_path	
pcb_path = doc.path
args = lcase(trim(args))
'if args ="" then exit sub

'// TODO
dim s,ls,i
s = split(pcb_path,"\")
ls = ubound(s)-lbound(s)+1
for i=0 to ls-2
	doc_parent = doc_parent & s(i) & "\"
next

dim usrpath
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject") 
select case args	
	case "root" 
		usrpath = root
	case "xs" 
		usrpath = root & "\skill"
	case "env" 
		usrpath = root & "\env"
	case "cam" 
		usrpath = root & "\config\cam"
	case "gerber" 
		usrpath = root & "\config\gerber"
	case "xy" 
		usrpath = root & "\cache\xy"
	case "smt" 
		usrpath = doc_parent & "smt"
	case "me" 
		usrpath = doc_parent & "me"
	case "doc" 
		usrpath = doc_parent & "doc"
	case "output" 
		usrpath = doc.path & "\output"
	case "pcb" 
		usrpath = doc.path
	case "prj" 
		usrpath = doc.path
	case "bak"
		usrpath = doc.path & "\bak"

end select
if len(usrpath)=0 then 
else
	'msgbox usrpath
if fso.FolderExists(usrpath)=false then
	fso.createFolder(usrpath)
end if
dim wsh
set wsh = createobject("wscript.shell")
wsh.run usrpath
set wsh = nothing
set fso = nothing
set doc = nothing
end if
